﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forum.Entity.Board;

namespace Forum.Entity.Post
{
    public partial class TopicInfo
    {
        private List<PostInfo> _posts;
        public Func<int, List<PostInfo>> GetPostList;
        public List<PostInfo> PostList
        {
            get
            {
                if (_posts == null)
                {
                    _posts = GetPostList(this.ID);
                }
                return _posts;
            }
        }

        private BoardInfo _boardInfo;
        public Func<int, BoardInfo> GetBoardInfo
        {
            get;
            set;
        }

        public BoardInfo BoardInfo
        {
            get
            {
                if (_boardInfo == null)
                {
                    _boardInfo = GetBoardInfo(this.BoardID);
                }
                return _boardInfo;
            }

        }
    }
}
